package com.cxso.example.client;


import com.cxso.example.enums.ProductClientEnum;
import com.cxso.example.request.report.*;
import com.cxso.example.sdk.domain.Result;
import com.cxso.example.sdk.http.base.HttpMethod;
import com.cxso.example.sdk.http.client.Client;
import com.cxso.example.sdk.http.core.ChoiceClient;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "聚合上报服务")
public class ReportClient extends Client {

    public ReportClient(ChoiceClient choiceClient) {
        super(choiceClient);
    }

    @Schema(description = "上报运单")
    public Result<?> reportWaybill(ReportWaybillRequest request) {
        return choiceClient.choice(ProductClientEnum.REPORT_PC.getCode()).execute("/monitor/api/reporting/createWaybill", HttpMethod.POST, request).toResult();
    }

    @Schema(description = "上报车辆")
    public Result<?> reportCar(ReportCarRequest request) {
        return choiceClient.choice(ProductClientEnum.REPORT_PC.getCode()).execute("/monitor/api/reporting/createCar", HttpMethod.POST, request).toResult();
    }

    @Schema(description = "上报司机")
    public Result<?> reportDriver(ReportDriverRequest request) {
        return choiceClient.choice(ProductClientEnum.REPORT_PC.getCode()).execute("/monitor/api/reporting/createDriver", HttpMethod.POST, request).toResult();
    }

    @Schema(description = "上报轨迹")
    public Result<?> reportTrack(ReportTrackRequest request) {
        return choiceClient.choice(ProductClientEnum.REPORT_PC.getCode()).execute("/monitor/api/reporting/createTrack", HttpMethod.POST, request).toResult();
    }

    @Schema(description = "上报合同")
    public Result<?> reportContract(ReportContractRequest request) {
        return choiceClient.choice(ProductClientEnum.REPORT_PC.getCode()).execute("/monitor/api/reporting/createContract", HttpMethod.POST, request).toResult();
    }

    @Schema(description = "上报流水")
    public Result<?> reportFinancial(ReportFinancialRequest request) {
        return choiceClient.choice(ProductClientEnum.REPORT_PC.getCode()).execute("/monitor/api/reporting/createFinancial", HttpMethod.POST, request).toResult();
    }

    @Schema(description = "上报发票")
    public Result<?> reportInvoice(ReportInvoiceRequest request) {
        return choiceClient.choice(ProductClientEnum.REPORT_PC.getCode()).execute("/monitor/api/reporting/createInvoice", HttpMethod.POST, request).toResult();
    }

    @Schema(description = "上报ETC发票")
    public Result<?> reportEtcInvoice(ReportEtcInvoiceRequest request) {
        return choiceClient.choice(ProductClientEnum.REPORT_PC.getCode()).execute("/monitor/api/reporting/createEtcInvoice", HttpMethod.POST, request).toResult();
    }

    @Schema(description = "上报货主")
    public Result<?> reportShipper(ReportShipperRequest request) {
        return choiceClient.choice(ProductClientEnum.REPORT_PC.getCode()).execute("/monitor/api/reporting/createShipper", HttpMethod.POST, request).toResult();
    }
}
